package genosAgape.util;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.TreeSet;

import javax.swing.DefaultComboBoxModel;

public class ItemsCombo < K,V > {
	private TreeSet<ItemMap< K,V >> items;
	
	public ItemsCombo(){
		this.items = new TreeSet<>(new Comparator<ItemMap>() {
			@Override
			public int compare(ItemMap o1, ItemMap o2) {
				return o1.compareTo(o2);
			}
		});
	}	
	public void add(K key, V value){
		ItemMap<K, V> item = new ItemMap<K, V>(key, value);
		this.items.add(item);
	}
	public DefaultComboBoxModel getModel(){
		DefaultComboBoxModel defaultComboBox = new DefaultComboBoxModel(items.toArray());  
		return defaultComboBox;
	}
	public TreeSet getItens(){
		return items;
	}
}
	